package cn.pomit.aliwork.dubbo.service.impl;

import java.net.InetAddress;
import java.net.UnknownHostException;

import org.apache.dubbo.config.annotation.Service;

import cn.pomit.aliwork.dubbo.model.ResultModel;
import cn.pomit.aliwork.dubbo.service.IpInfoService;

@Service
public class IpInfoServiceImpl implements IpInfoService{

	@Override
	public ResultModel getIpInfo() {
		String result = "";
		try {
			InetAddress address = InetAddress.getLocalHost();
			result = address.getHostAddress();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		}
		return ResultModel.ok(result);
	}

}
